package com.example.tibetanmedicinechest.Exception;

import lombok.Data;

/**
 * 一般将异常分为三大类
 *1.业务异常BUsinessException
 * 2.系统异常SystemException
 * 3.其他异常Exception
 */
@Data
public class BusinessException extends RuntimeException{
    private int code;

    public BusinessException(int code) {
        this.code = code;
    }

    public BusinessException(String message, int code) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause, int code) {
        super(message, cause);
        this.code = code;
    }

    public BusinessException(Throwable cause, int code) {
        super(cause);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int code) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
    }
}
